package com.fau.om.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.json.simple.JSONAware;
import org.json.simple.JSONObject;

/**
 * @desc 地址城市表实体类
 * @author kangyj
 * @datetime 2014年11月8日,下午5:37:06
 */
@Entity
@Table(name = "medical_city")
public class MedicalCity implements Serializable, JSONAware {

	private static final long serialVersionUID = 3534576542695254340L;
	
	private String id;
	private String cName;		// 城市名称
	private String zipCode;		// 邮编
	private String pId;			// 省份id
	
	@Id
	@GenericGenerator(name = "generator", strategy = "assigned")
	@GeneratedValue(generator = "generator")
	@Column(name = "id", length = 20)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "c_name", length = 50)
	public String getcName() {
		return cName;
	}

	public void setcName(String cName) {
		this.cName = cName;
	}

	@Column(name = "zip_code", length = 50)
	public String getZipCode() {
		return zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	@Column(name = "p_id", length = 20)
	public String getpId() {
		return pId;
	}

	public void setpId(String pId) {
		this.pId = pId;
	}


	@SuppressWarnings("unchecked")
	@Override
	public String toJSONString() {
		JSONObject obj = new JSONObject();
		obj.put("id", id);
		obj.put("cName", cName);
		obj.put("zipCode", zipCode);
		obj.put("pId", pId);
		return obj.toString();
	}

}
